package definition;

import domain.SuperUser;
import domain.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author wugang
 * @date 2021-09-27
 */
public class ClassPathXmlApplicationContextTest {
    public static void main(String[] args) {
        ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("bean-context.xml");
        Object user = applicationContext.getBean("user", User.class);
        // superUser 继承 User
        SuperUser superuser = applicationContext.getBean("superUser", SuperUser.class);

        System.out.println("user>"+user);
        System.out.println("superUser>"+superuser);
    }
}
